-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type alias syntax & semantics #591
base: main
Are you sure you want to change the base?
Conversation
It looks like you need to regenerate the trace info for the native build. See the instructions here: https://github.com/nasa/fpp/tree/main/compiler#building-native-binaries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! As discussed, let's separate out the removal of "built-in types," because removing those requires changes to F Prime. For now let's move forward with the syntax, semantics, and code generation of type aliases, without removing built-in types.
Another issue I see is that the code generator is generating an empty TypesAc.cpp file. I think we should suppress the generation of this file. Does that require any changes to the CppDoc framework? |
@bocchino You may need to do the trace updates again, I can't install GraalVM for Java11 since the only version available from Homebrew is jdk23 and the SDKMAN/official installation method seems to only have 17, 21, and 23. We may also want to consider updating the Java version or putting the trace updates in CI |
compiler/lib/src/main/scala/analysis/Analyzers/TypeExpressionAnalyzer.scala
Outdated
Show resolved
Hide resolved
compiler/lib/src/main/scala/codegen/CppWriter/CppWriterState.scala
Outdated
Show resolved
Hide resolved
compiler/lib/src/main/scala/codegen/CppWriter/TypeCppWriter.scala
Outdated
Show resolved
Hide resolved
Noted. The trace updates are supposed to be in CI, but they have never worked, and instead of wrangling CI I have just updated them manually. @LeStarch do you see any issue with updating the FPP Java environment from Java 11 to Java 17? We would need to do this in the GitHub actions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I added some comments.
We also discussed adding a few tests for type aliases to the ScalaTest tests. Can we do that in this PR?
I opened an issue on upgrading Java: #605. |
As discussed, I'll resolve the conflict in the native image trace file. |
I resolved the conflict. It looks like there is a test failure for |
…umbar-type-alias-syntax
I added some scala tests and found an issue in the For example:
|
Part of #113. This finishes up some changes made in #549 for syntax & semantics implementation. It adds a test to generate a struct that references a type alias.
No C++ code is generated yet for type aliases. In model elements that use type aliases, the type aliases are converted to their underlying types before generating C++ code.